/*
 *   ,           ,   Perror Exit - Some things I like to code with
 *  /             \  Copyright  (C) 2003 Andrew Morrison
 * ((__-^^-,-^^-__))
 * `-_---'  `---_-'  This program is free software; you can redistribute it and/or
 *  `--|o`   'o|--'  modify it under the terms of the   GNU General Public License
 *      \  `  /      as published by the Free   Software Foundation; either version 2
 *       ): :(       of the License, or (at your option) any later version.
 *       :o_o:
 *        "-"
 *                   This program is distributed in the hope that it will be useful,
 *                   but WITHOUT ANY WARRANTY;  without even the implied warranty of
 *                   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See  the
 *                   GNU General Public License for more details.
 *
 *                   The GPL may be obtained at http://www.gnu.org/copyleft/gpl.html
 */
#ifndef _PERROR_EXIT_H_
# define _PERROR_EXIT_H_


#include <stdlib.h>
#include <stdarg.h>

#define perror_exit(fmt,...)   { perror(cat(fmt,##__VA_ARGS__)); exit(EXIT_FAILURE); }
#define perror_noexit(fmt,...) { perror(cat(fmt,##__VA_ARGS__)); }
#define error_exit(fmt,...)    { fprintf(stderr,fmt,##__VA_ARGS__); exit(EXIT_FAILURE); }
#define error_noexit(fmt,...)  { fprintf(stderr,fmt,##__VA_ARGS__); }

char *cat(const char *fmt, ...);
char *chomp(char *string);

#define TIMER_START() time_it()
#define TIMER_STOP()  time_it()

void
time_it (void);

#endif
